//#define __FORCE_TRACE__
//#define __FORCE_DEBUG__
//#define __FORCE_INFO__
#define THIS_FILE "tools\fn_createGroup.sqf"
#include <tmf_constants.h>
#include <tmf_macros.h>

TRACE_1("Start",_this);
TMFPROFILERSTART;

private ["_grp","_side"];
_side = GVAR(side_enemy);
if (IS_ARRAY(_this)) then {
DEFAULT_PARAM(_side,0,GVAR(side_enemy));
} else {
_side = _this;
};
_grp = grpNull;
if (!isNil "mso_fnc_createGroup") then {
	if (IS_GROUP(_side)) then {
		_grp = _side;
	} else {
		_side = [_side] call FFUNC(getSide);
		_grp = [_side] call mso_fnc_createGroup;
	};
} else {
	if (IS_GROUP(_side)) then {
		_grp = _side;
	} else {
		_side = [_side] call FFUNC(getSide);
		_grp = createGroup _side;
		_grp setVariable [QGVAR(CREATED), time + 120];
		_grp setVariable [QGVAR(SMOKEUNITS), []];
	};
};
TRACE_1("End",_grp);
TMFPROFILERSTOP;
_grp